package de.clue.corpus.twitter.reader;

import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import de.clue.corpus.twitter.util.Tools;

public class DuplicateElementAppender implements IElementAppender {

	private static Vector<String> hashKeys = new Vector<String>();
    
    
    @Override
    public void process(StringBuffer output, String message) {
    	String duplicate = "FALSE";
    	
    	String hash = Tools.getHash(message);
    	
    	if(hashKeys.contains(hash)){
    		duplicate = "TRUE";
    	} else {
    		hashKeys.add(hash);
    	}
        
        output.append("<duplicate>");
		output.append(duplicate);
        output.append("</duplicate>");
        

    }

}
